<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>我的钱包</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta name="format-detection" content="telephone=no" />
	<link rel="stylesheet" href="../../css/public-heder-Reset.css">
	<link rel="stylesheet" href="../../css/U-account-analysis.css">
</head>
<body>
	<!-- page_box -->
	<div class="page-box">
		<!-- header -->
		<header class="page-header">
			<a href="javascript:history.go(-1)" class="back"></a>
			<p class="pege-name">我的钱包</p>
		</header>
		<div class="liubai"></div>
		<!-- header /-->
		<div id="canvas-holder" style="text-align:center;padding-bottom:30px 0">
			<div class="Name">
				<p>资金分析</p>
			</div>
			<canvas id="chart-area" width="180" height="180"/></canvas>	
			<div class="text">
				<p>持有资产(元)</p>
				<span class="have"></span>
			</div>
		</div>
		<div class="account-data">
			<ul class="data">
				<li>
					<i></i>
					<p> 可用余额</p>
					<em></em>
					<span class="canuse"></span>
				</li>
				<li>
					<i></i>
					<p> 待收本金</p>
					<em></em>
					<span class="willcorpus"></span>
				</li>
				<li>
					<i></i>
					<p>待收收益</p>
					<em></em>
					<span class="willprofit"></span>
				</li>
				<li>
					<i></i>
					<p> 冻结金额</p>
					<em></em>
					<span class="frostmoney"></span>
				</li>
			</ul>
		</div>
		<div class="data-bt">
			<ul class="clear">
				<li>投资总金额</li>
				<li>收益总金额</li>
				<li>已收益</li>
				<li class="invest">00.00元</li>
				<li class="allprofit">00.00元</li>
				<li class="profit">00.00元</li>
			</ul>
		</div>
	</div>
	<script type="text/javascript" src="../../js/jquery.min.js"></script>
	<script type="text/javascript" src="../../js/http-url.js"></script>
	<script type="text/javascript" src="../../js/Chart.js"></script>
	<script>
	$(function(){
		ajaxRequest('/api/user/bag',null,function(data){
        $('.canuse').text(data.data.money.canuse+'元')//可用余额
        $('.willcorpus').text(data.data.money.willcorpus+'元')//待收本金
        $('.willprofit').text(data.data.money.willprofit+'元')//待收收益
        $('.frostmoney').text(data.data.money.frostmoney+'元')//冻结金额
        $('.allprofit').text(data.data.money.allprofit+'元')//总收益
        $('.invest').text(data.data.money.invest+'元')//总投资
        $('.profit').text(data.data.money.profit+'元')//已收收益
        $('.have').text(data.data.money.have+'元')//持有总资产
        var doughnutData = [
				{
					value:eval(data.data.money.r_willcorpus),
					color:"#f46a34",
					highlight: "#f46a34",
					label: "待收本金"
				},
				{
					value:eval(data.data.money.r_willprofit),
					color: "#85cc5f",
					highlight: "#85cc5f",
					label: "待收收益"
				},
				{
					value:eval(data.data.money.r_canuse),
					color: "#ffc234",
					highlight: "#ffc234",
					label: "可用余额"
				},
				{
					value:eval(data.data.money.r_frostmoney),
					color: "#6cb4fd",
					highlight: "#6cb4fd",
					label: "冻结资金"
				},
				{
					value:0.00000000000000000000001,
					color: "#ccc",
					highlight: "#ccc",
					label: "无可用金额"
				},
			];
			// window.onload = function(){
				var ctx = document.getElementById("chart-area").getContext("2d");
				window.myDoughnut = new Chart(ctx).Doughnut(doughnutData, {responsive :false,});
			// };
		},false)
	})
	
	
	</script>
	</body>
</html>
